package com.arcaneshift.servlet.action.game;

import java.util.HashSet;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.arcaneshift.model.action.game.BattleEngine;
import com.arcaneshift.model.request.SummonCreatureCardRequest;
import com.arcaneshift.model.validators.GameValidator;
import com.arcaneshift.servlet.util.network.RequestAction;
import com.arcaneshift.servlet.util.parser.SummonCreatureCardXMLParser;
import com.arcaneshift.util.GameCacheContainer;
import com.common.model.abstracts.AbstractRequest;
import com.common.model.abstracts.AbstractValidator;
import com.common.model.validators.ActionValidator;
import com.common.servlet.abstracts.AbstractParserServlet;
import com.common.servlet.interfaces.IParser;

public class SummonCreatureCardServlet extends AbstractParserServlet {
	private static final long serialVersionUID = 1L;
	private static Set<AbstractValidator> validators = new HashSet<AbstractValidator>();
	
	private SummonCreatureCardRequest requestContent;
	private SummonCreatureCardXMLParser parser = new SummonCreatureCardXMLParser();

	static {
		validators.add(new ActionValidator(RequestAction.SUMMON_CREATURE_CARD));
		validators.add(new GameValidator());
	}
	
	@Override
	public void handle(HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		BattleEngine game = GameCacheContainer.getGame(requestContent.getGameId());
		//game.c
	}

	@Override
	public void setRequest(AbstractRequest abstractRequest) {
		requestContent = (SummonCreatureCardRequest) abstractRequest;
	}

	@Override
	public Set<AbstractValidator> getValidators() {
		return validators;
	}

	@Override
	public IParser parser() {
		return parser;
	}
}
